package com.ntschy.bt.entity.enums.btpolicyEnum;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;

@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum BtPolicyAuditStatusEnum implements IEnum<Integer> {
    /**
     * 审核状态 0-待审核 1-已退回 2-已通过
     */
    TO_WAIT(0,"待审核"),
    TO_PAST(1,"已通过"),
    TO_BACK(2,"已退回");
    private final int value;

    private final String desc;

    BtPolicyAuditStatusEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return desc;
    }

    @JsonCreator
    public static BtPolicyAuditStatusEnum getBtPolicyAuditStatusEnumValue(Integer value) {
        for (BtPolicyAuditStatusEnum companyStatus : BtPolicyAuditStatusEnum.values()) {
            if (companyStatus.getValue() == value) {
                return companyStatus;
            }
        }
        return null;
    }
}
